Check Euler number

n = 10
 EE = exp(1.0)
 DO i = 1, nn
    E = (1.0 + 1.0/n)**n
    write(*,*) n, E, abs(E-EE)
    n = n*10
 END DO

In [1]:
import math

In [3]:
math.exp(1)


Out[3]:
2.718281828459045

In [4]:
def euler_n(n):
    return (1+1/n)**n

In [15]:
for i in range(1,100000000):
    error=euler_n(i)-math.exp(1)
    #print("error: {}".format(euler_n(i)-math.exp(1)))
print(error)


3.063474807163402e-09

In [16]:
import numpy as np

In [17]:
a=np.array([1,2])
b=np.array([3,4])
np.concatenate((a,b))


Out[17]:
array([1, 2, 3, 4])

In [ ]: